package com.ruoyi.a2.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruoyi.a2.domain.A2StaticInfo;
import com.ruoyi.common.enums.CommonOKNOEnum;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.a2.mapper.A2PdccMapper;
import com.ruoyi.a2.domain.A2Pdcc;
import com.ruoyi.a2.service.IA2PdccService;

/**
 * 点位数据清洗配置Service业务层处理
 *
 * @author ruoyi
 * @date 2025-02-14
 */
@Service
public class A2PdccServiceImpl extends ServiceImpl<A2PdccMapper, A2Pdcc> implements IA2PdccService
{
    @Autowired
    private A2PdccMapper a2PdccMapper;

    /**
     * 查询点位数据清洗配置
     *
     * @param id 点位数据清洗配置主键
     * @return 点位数据清洗配置
     */
    @Override
    public A2Pdcc selectA2PdccById(Long id)
    {
        return a2PdccMapper.selectA2PdccById(id);
    }

    /**
     * 查询点位数据清洗配置列表
     *
     * @param a2Pdcc 点位数据清洗配置
     * @return 点位数据清洗配置
     */
    @Override
    public List<A2Pdcc> selectA2PdccList(A2Pdcc a2Pdcc)
    {
        return a2PdccMapper.selectA2PdccList(a2Pdcc);
    }

    /**
     * 新增点位数据清洗配置
     *
     * @param a2Pdcc 点位数据清洗配置
     * @return 结果
     */
    @Override
    public int insertA2Pdcc(A2Pdcc a2Pdcc)
    {
        a2Pdcc.setCreateTime(DateUtils.getNowDate());
        return a2PdccMapper.insertA2Pdcc(a2Pdcc);
    }

    /**
     * 修改点位数据清洗配置
     *
     * @param a2Pdcc 点位数据清洗配置
     * @return 结果
     */
    @Override
    public int updateA2Pdcc(A2Pdcc a2Pdcc)
    {
        a2Pdcc.setUpdateTime(DateUtils.getNowDate());
        return a2PdccMapper.updateA2Pdcc(a2Pdcc);
    }

    /**
     * 批量删除点位数据清洗配置
     *
     * @param ids 需要删除的点位数据清洗配置主键
     * @return 结果
     */
    @Override
    public int deleteA2PdccByIds(Long[] ids)
    {
        return a2PdccMapper.deleteA2PdccByIds(ids);
    }

    /**
     * 删除点位数据清洗配置信息
     *
     * @param id 点位数据清洗配置主键
     * @return 结果
     */
    @Override
    public int deleteA2PdccById(Long id)
    {
        return a2PdccMapper.deleteA2PdccById(id);
    }

    @Override
    public List<A2Pdcc> getListByEnableOK() {
        QueryWrapper<A2Pdcc> wrapper = new QueryWrapper<>();
        wrapper.eq("enable_status", CommonOKNOEnum.OK.getCode());
        return list(wrapper);
    }
}
